package com.oschina.wed.common.enums;

/**
 * 资金方向
 * IN：收入；
 * OUT：支出
 */
public enum VoucherFlowDirectionEnum {
    IN(0),
    OUT(1);

    VoucherFlowDirectionEnum(Integer directionCode){
        this.direction = directionCode;
    }

    private Integer direction;

    public static VoucherFlowDirectionEnum getByDirectionCode(Integer directionCode){
        if(directionCode == null)
            return null;

        for (VoucherFlowDirectionEnum voucherFlowDirectionEnum : VoucherFlowDirectionEnum.values()) {
            if(voucherFlowDirectionEnum.getDirection().equals(directionCode)){
                return voucherFlowDirectionEnum;
            }
        }

        return null;
    }

    public Integer getDirection() {
        return direction;
    }

    public void setDirection(Integer direction) {
        this.direction = direction;
    }
}
